package com.matrix.java.chap_04.example;

import java.util.Scanner;

public class Case4_02 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("Enter the first city: ");
        String city1 = input.nextLine();
        System.out.print("Enter the second city: ");
        String city2 = input.nextLine();
        if (city1.compareToIgnoreCase(city2) > 0) {
            System.out.println("The cities in alphabetical order are: " + city2 + " " + city1);
        } else {
            System.out.println("The cities in alphabetical order are: " + city1 + " " + city2);
        }
        input.close();
    }
}
